package com.hifar.test.unitstandardrelation.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hifar.test.standardbase.pojo.HfResStandard;
import com.hifar.test.unitstandardrelation.pojo.HfPrjUnitStandard;
import com.hifar.test.unitstandardrelation.pojo.HfPrjUnitStandardVo;

/**
 * <p>
 * 项目-检测项目-标准 mapper接口
 * </p>
 *
 * @author wangkepeng
 * @since 2024-12-05 09:22:13
 */
@Mapper
public interface HfPrjUnitStandardMapper extends BaseMapper<HfPrjUnitStandard> {


    List<HfResStandard> selectUnitStandardList(@Param("id") String id);

    @Select(" SELECT * from ( select t.*,d.STANDARD_NAME,d.STANDARD_CODE from HF_PRJ_UNIT_STANDARD t left join HF_RES_STANDARD d on t.standard_id=d.id "
            + " ) x     ${ew.customSqlSegment}  ")
    Page<HfResStandard> pageHfResStandardVo(Page<HfResStandard> rowPage, @Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select(" SELECT * from ( select t.*,d.STANDARD_NAME,d.STANDARD_CODE from HF_PRJ_UNIT_STANDARD t left join HF_RES_STANDARD d on t.standard_id=d.id "
            + " ) x     ${ew.customSqlSegment}  ")
    Page<HfPrjUnitStandardVo> pageHfPrjUnitStandardVo(Page<HfPrjUnitStandardVo> rowPage, @Param(Constants.WRAPPER) QueryWrapper wrapper);

    @Select(" SELECT * from ( select t.*,d.STANDARD_NAME,d.STANDARD_CODE from HF_PRJ_UNIT_STANDARD t left join HF_RES_STANDARD d on t.standard_id=d.id "
            + " ) x     ${ew.customSqlSegment}  ")
    List<HfPrjUnitStandardVo> listHfPrjUnitStandardVo(@Param(Constants.WRAPPER) QueryWrapper<HfPrjUnitStandardVo> wrapper);
}